package com.luocj.muke.demo.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.luocj.muke.demo.R;
import com.luocj.muke.demo.activity.DiversActivity;
import com.luocj.muke.demo.activity.LinearDiverActivity;

public class ReviewFragment extends Fragment implements View.OnClickListener {

    private static final String TAG = ReviewFragment.class.getSimpleName();
    private View inflate;
    private Button btnSocket;
    private Button btnLinearn;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        inflate = inflater.inflate(R.layout.review_fragment, container, false);
        return inflate;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        btnSocket = inflate.findViewById(R.id.btn_listview_with_line);
        btnSocket.setOnClickListener(this);

        btnLinearn = inflate.findViewById(R.id.btn_linearn_recyclerview);
        btnLinearn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.btn_listview_with_line:

                getActivity().startActivity(new Intent(getActivity(), DiversActivity.class));

                break;
            case R.id.btn_linearn_recyclerview:
                getActivity().startActivity(new Intent(getActivity(),LinearDiverActivity.class));
                break;
        }
    }

}
